<template>
  <my-layout :sTitle="detailList.name">
    <div slot="content">
      <div class="f-app">
        <div class="floor-box">
          <img :src="detailList.logo" alt>
          <div class="bottom-box">
            <p class="title">{{detailList.name}}</p>
            <p class="address">
              <i>
                <img src="@/assets/images/addr.png" alt>
              </i>
              {{detailList.prov}}{{detailList.city}}{{detailList.dist}}{{detailList.addr}}
            </p>
          </div>
        </div>
        <div class="huxing">
          <div class="label-title">户型</div>
          <swiper :options="swiperOption">
            <swiperSlide v-for="(item,i) in detailList.houses" :key="i">
              <div class="w-slide-item">
                <img :src="item.pic">
              </div>
              <div class="hx-size">
                <img src="@/assets/images/Group201.png" alt>
                <span class="hx">{{item.name}}</span>
                <img src="@/assets/images/area.png" alt>
                <span class="size">{{item.area}}</span>
              </div>
            </swiperSlide>
          </swiper>
        </div>
      </div>
    </div>
  </my-layout>
</template>

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";

export default {
  components: {
    swiper,
    swiperSlide
  },
  data() {
    return {
      detailList: [],
      items: [
        {
          src:
            "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/house/1537342012403.户型图1.1.jpg"
        },
        {
          src:
            "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/house/1537342012403.户型图1.1.jpg"
        },
        {
          src:
            "http://xlylf-hlj.oss-cn-hangzhou.aliyuncs.com/house/1537342012403.户型图1.1.jpg"
        }
      ],
      swiperOption: {
        slidesPerView: "auto",
        loopedSlides: 3
      }
    };
  },
  methods: {
    async getDetail() {
      let id = this.$route.query.id;
      const { data } = await this.$http.post("lp/detail", {
        id: id
      });
      if (data.code == 0) {
        this.detailList = data.lp;
      } else {
      }
    }
  },
  mounted() {
    this.getDetail();
  }
};
</script>

<style lang="scss">
.f-app {
  padding-bottom: 100px;
  .floor-box {
    position: relative;
    > img {
      width: 100%;
      height: 614px;
    }
    .bottom-box {
      height: 164px;
      left: 0;
      right: 0;
      bottom: 0;
      background: #fff;
      opacity: 0.8;
      position: absolute;
      padding-left: 24px;
      .title {
        font-size: 36px;
        font-weight: 500;
        color: #333;
        margin: 0;
        line-height: 80px;
      }
      .address {
        font-size: 32px;
        color: #333;
        margin: 0;
        // margin-top: 26px;

        img {
          width: 22px;
          height: 32px;
          margin-right: 20px;
          margin-top: -5px;
          vertical-align: middle;
        }
      }
    }
  }
  .huxing {
    margin-top: 60px;
    padding-left: 48px;
    .label-title {
      font-weight: 500;
      color: #333;
      font-size: 36px;
      margin-bottom: 30px;
    }
    .swiper-slide {
      width: 620px;
      height: 564px;
      background: #f7f7f7;
      padding: 24px;
      margin-right: 36px;
    }
    .w-slide-item {
      img {
        width: 100%;
        height: 432px;
      }
    }
    .hx-size {
      font-size: 32px;
      line-height: 100px;

      img {
        margin-right: 16px;
        vertical-align: middle;
        margin-top: -8px;
      }

      .hx {
        margin-right: 80px;
      }
    }
  }
}
</style>
